//
//  TableViewCell.m
//  fp
//
//  Created by xingshuai on 2020/11/10.
//

#import "TableViewCell.h"

@interface TableViewCell ()

// 图标
@property (nonatomic, strong) UIImageView *img;
// cell文字
@property (nonatomic, strong) UILabel *label;

@end

@implementation TableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.img = [[UIImageView alloc]init];
        [self.contentView addSubview:self.img];
        [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.equalTo(self.contentView.mas_left).offset(15);
            make.size.mas_offset(CGSizeMake(30, 30));
        }];
        
        self.label = [[UILabel alloc]init];
        self.label.textColor = [UIColor colorWithHexString:@"#3B3B3B"];
        self.label.font = [UIFont pingFangSCWithWeight:FontWeightStyleRegular size:16];
        [self.contentView addSubview:self.label];
        [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.img);
            make.left.equalTo(self.img.mas_right).offset(4);
        }];
    }
    return self;
}

-(void)cellLoadImg:(NSString *)imgStr cellStr:(NSString *)cellStr {
    self.img.image = [UIImage imageNamed:imgStr];
    self.label.text = cellStr;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
